home *** CD-ROM | disk | FTP | other *** search
- Path: news.PBI.net!usenet
- From: mich@pbinet.com
- Newsgroups: comp.lang.c
- Subject: Re: GNU C & pow(x,y)
- Date: 25 Feb 1996 16:11:49 GMT
- Organization: Pacific Bell Internet Services
- Message-ID: <4gq1o5$386@SNFC21_SRVR_WWW.PBI.net>
- References: <9602162139036@br-ranch.org>
- Reply-To: mich@pbinet.com
- NNTP-Posting-Host: ppp-5-8.rdcy01.pbinet.com
- X-Newsreader: IBM NewsReader/2 v1.03
-
- In <9602162139036@br-ranch.org>, robert.threet@br-ranch.org (Robert Threet) writes:
- >I've tried using 1/x instead of the negative exponent, but I don't
- >think that's my problem. Here's the line:
-
- > paymnt = pow((amt * mo_rate)/(1-(1 + mo_rate)), (-mo_rate));
-
- >All variables are defined as floating point. I've included
- >"math.h" and I use this to compile:
-
- > gcc -o mort mort.c -lm
-
- >Despite this I keep getting the error: "undefined ref. to pow".
-
- >Can someone...
-
- >A) Tell me what I'm doing wrong... or
- >B) Give me a better formula for calculating a mortgage payment?
-
- I don't think your formula is the problem. Don't you need to explicately name the
- object file on the command line for GCC? Also, you might make sure you're using
- function prototypes.
-
-